//package objectRank;
//
//import java.io.Serializable;
//
//import edu.fiu.cis.personalize.server.GraphMediator;
//import edu.fiu.cis.personalize.server.graph.NodeType;
//import edu.fiu.cis.personalize.server.graph.Query;
//import edu.fiu.cis.personalize.server.graph.User;
//
///**
// * 
// * @author Reza
// */
//public class GraphBean implements Serializable {
//	
//	// String accessToken =
//	// "198452336852498|1112645c33fabd1f04da4afd-597296639|Mh2Rvu_-tbqvQrGwyqvnVOEDzNM";
//
////	String query;
////	String user;
//	// String document;
//	//HashMap<Node, Double> graphRanks;
//	//LinkedList<GoogleDocument> googleDocuments;
//	//LinkedHashMap<GoogleDocument, Double> finalOutput;
//	//QueryGraph queryGraph;
//
//	// ObjectOutputStream objectOut = null;
//	// File file1;
//
////	public GraphBean() {
////		this.query = null;
////		// this.document = null;
////		this.graphRanks = new HashMap<Node, Double>();
////		this.googleDocuments = new LinkedList<GoogleDocument>();
////		this.finalOutput = new LinkedHashMap<GoogleDocument, Double>();
////
////		GraphExample facebookGraph = null;// new GraphExample(accessToken);
////		List<Group> groups = facebookGraph.fqlGroups();
////		Iterator<Group> itr = groups.iterator();
////		HashSet<String> newGroups = new HashSet<String>();
////		String ttt;
////		// System.out.println("groups in facebook are " + groups.size());
////		while (itr.hasNext()) {
////			ttt = ">>group>> ".concat(itr.next().getDescription());
////			newGroups.add(ttt);
////			// System.out.println(ttt);
////		}
////		// Long uid = facebookGraph.getUserId();
////		user = ">>user>> ".concat(facebookGraph.fqlUserName());
////		System.out.println(user);
////
////	}
//
//	public void querySubmitted(String query) {
//		this.query = query;
//		User u = (User) GraphMediator.get().get(user, NodeType.USER, false);
//		Query q = (Query) GraphMediator.get().get(user, NodeType.QUERY, true);
//		queryGraph.addEdge(u, q);
//		queryGraph.addEdge(q, u);
//		System.out.println("query <-> user edges are added.");
//	}
//
////	public void addGoogleDocs(String[] documents, String[] titles) {
////		GoogleDocument doc;
////		System.out.println(documents.length + "," + documents.length + ","
////				+ documents.length + " are being added.");
////		if (documents.length != titles.length) {
////			for (int i = 0; i < documents.length - 1; i++) {
////				doc = new GoogleDocument(documents[i], titles[i]);
////				googleDocuments.add(doc);
////			}
////		} else {
////			for (int i = 0; i < documents.length; i++) {
////				doc = new GoogleDocument(documents[i], titles[i]);
////				googleDocuments.add(doc);
////			}
////		}
////
////		System.out.println("google docs are added.");
////	}
//
//	
//	public void calculateRank(String query) {
//		Query tempQ = (Query) GraphMediator.get().get(query, NodeType.QUERY,
//				false);
//		queryGraph.calculateRootSet(tempQ);
//		queryGraph.calculateBaseSet();
//		graphRanks = queryGraph.calculateObjectRank();
//		System.out.println("rank is calculated.");
//	}
//
//	public void integrateWithGoogle() {
//		finalOutput = queryGraph.integrateWithGoogle(graphRanks,
//				googleDocuments);
//		System.out.println("integrated with google.");
//	}
//
//	
//}
